package com.ming.interview;

import java.util.Scanner;

/**
 * @Description 给一个不多于5位的正整数，要求：一、求它是几位数，二、逆序打印出各位数字。
 * @Author ye.ming
 * @Date Created in 2019/8/26
 */
public class Main21_2 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();

        int i = 0;
        int[] arr = new int[5];
        int temp= 0;

        do {
            arr[i] = num % 10;
            num = num / 10;
            i++;
        } while (num != 0);

        System.out.println(i);
        for (int j = 0; j < i; j++) {
            System.out.print(arr[j]);
        }

        sc.close();
    }


    private static void m1(int m, int n) {

    }


}
